<style>
   .banner-img{width:80%;} 
</style>
<div class="row">
	<ol class="breadcrumb">
		<li><a href="{:U('Index/index')}"><span class="glyphicon glyphicon-home"></span></a></li>
		<li class="active">首页设置</li>
	</ol>
</div><!--/.row-->

<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">首页设置</h1>
    </div>
</div><!--/.row-->

<div class="col-md-12">
    <div class="panel panel-default ">
        <div class="panel-body tabs">
            <ul class="nav nav-tabs">
                <li <?php if($type==1){echo 'class="active"';}?> <?php if($type==""){echo 'class="active"';}?>><a href="#tab1" data-toggle="tab">banner设置</a></li>
                <li class=""><a href="#tab2" data-toggle="tab">轮播设置</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane fade <?php if($type==1){echo 'active in';}?><?php if($type==""){echo 'active in';}?>" id="tab1">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="panel panel-default">
                                <div class="panel-heading text-center">
                                banner
                                </div>
                                <form action="{:U('Index/bannerSet')}" method="post" enctype="multipart/form-data">
                                    <?php foreach($bannerlist as $k=>$v){ ?>
                                    <div class="alert bg-primary" role="alert">
                                        <img src="<?php echo $v['imgurl'];?>" class="banner-img">
                                        <a href="<?php echo U('Index/bannerDel',array('id'=>$v['Id'])); ?>" class="pull-right">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </a>
                                    </div>
                                    <?php } ?>
                                    <div class="form-group">
                                        <label>上传banner</label>
                                        <input type="file" name="banner">
                                        <p class="help-block">请上传banner图片，（大小小于2M）</p>
                                        <button type="submit" class="btn btn-primary">确定</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab-pane fade <?php if($type==1){echo 'active in';}?>" id="tab2">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading text-center">
                                轮播
                            </div>
                            <form action="{:U('Index/carousel_display')}" method="post" enctype="multipart/form-data">
                                <?php foreach($carousellist as $k=>$v) { ?>
                                <div class="panel-body col-md-4">
                                    <img src="<?php echo $v['imgurl'];?>" class="img-carousel" alt="">
                                    <a href="<?php echo U('Index/carouselDel',array('id'=>$v['Id'])); ?>" class="pull-right"><span class="glyphicon glyphicon-remove"></span></a>    
                                </div>
                                <?php } ?>
                                <div class="form-group col-md-12">
                                    <label>上传项目图片</label>
                                    <input name="carousel" type="file">
                                    <p class="help-block">请上传项目图片，（大小小于2M）</p>
                                    <button type="submit" class="btn btn-primary">确定</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div><!--/.panel-->
</div>
